From: Matthijs Velsink Date: Sun, 15 Dec 2024 20:53:06 +0000 (+0100) Subject: status/a11y: Block 'toggled' signal when manually toggling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~177^2^2~6 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e163be9885c152665fc4aa81125d32b6e033bbd2;p=gnome-shell.git status/a11y: Block 'toggled' signal when manually toggling When the 'text-scaling-factor' key changes and it's set bigger than 1.0, the corresponding switch is activated in the a11y menu. However, since commit 946ee936926a0e14fa5f86f62da757bcb581a147, setting the state using `setToggleState()` also fires the 'toggled' signal, which is I think correct and intended. However, that means the GSettings handler for 'text-scaling-factor' should block that 'toggled' handler when it sets the switch active, as otherwise the 'text-scaling-factor' is always set to 1.25 when it is first made bigger than 1.0. Part-of: (cherry picked from commit 1e6c92a083864da9914078990210c1eb38c38cb1) --- diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js index 44c9dc9f9..2a98374ac 100644 --- a/js/ui/status/accessibility.js +++ b/js/ui/status/accessibility.js @@ -122,7 +122,7 @@ class ATIndicator extends PanelMenu.Button { const widget = new PopupMenu.PopupSwitchMenuItem(_('Large Text'), factor > 1.0); - widget.connect('toggled', item => { + const toggledId = widget.connect('toggled', item => { if (item.state) settings.set_double(KEY_TEXT_SCALING_FACTOR, DPI_FACTOR_LARGE); else @@ -132,7 +132,10 @@ class ATIndicator extends PanelMenu.Button { settings.connect(`changed::${KEY_TEXT_SCALING_FACTOR}`, () => { factor = settings.get_double(KEY_TEXT_SCALING_FACTOR); let active = factor > 1.0; + + widget.block_signal_handler(toggledId); widget.setToggleState(active); + widget.unblock_signal_handler(toggledId); this._queueSyncMenuVisibility(); });